﻿using System;
using System.Web.Mvc;
using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
using DotNetOpenAuth.OpenId.RelyingParty;
using OpenIdPortableArea.Messages;

namespace OpenIdPortableArea.Areas.OpenId.Services
{
    /// <summary>
    /// An authentication service interface designed to handle claims requests, and interacting with the host application.
    /// </summary>
    public interface IAuthenticationService
    {
        /// <summary>
        /// Adds a ClaimsRequest
        /// </summary>
        /// <param name="claim"></param>
        void AddClaim(ClaimsRequest claim);

        /// <summary>
        /// Gets the AuthenticationStatus
        /// </summary>
        /// <returns></returns>
        AuthenticationStatus GetAuthenticationStatus();

        /// <summary>
        /// Determines if an openIdUrl is 
        /// </summary>
        /// <param name="openIdUrl"></param>
        /// <param name="callbackUrl"></param>
        /// <returns></returns>
        bool IsValid(string openIdUrl, Uri callbackUrl);

        /// <summary>
        /// Logsout the user
        /// </summary>
        void Logout();

        /// <summary>
        /// Redirects the user
        /// </summary>
        /// <returns></returns>
        ActionResult Redirect();

        /// <summary>
        /// Set the AuthenticatedMessage
        /// </summary>
        /// <param name="message"></param>
        void SetMessage(AuthenticatedMessage message);

    }
}
